#ifndef INFOSET_H
#define INFOSET_H

#include <vector>
#include "info.h"
#include "infoid.h"
#include "serialization.h"

#define IS_SOURCE_NOT_FOUND -1

class InfoSet
{
	public:
	InfoSet(EInfoId _iid);
	
	/* access and update functions */
	void addInfo(Info& info);
    EInfoId id() const;
	int first(EInfoSource src); /* vector index. IS_SOURCE_NOT_FOUND if not found */
	int amount(EInfoSource src); /* amount of infos of source src */
	bool isEmpty() const;

    /* stream functions */
    void toStream(std::ostream& os, unsigned int indent=0, ESerializationType sertype=stFull) const;
	friend std::ostream& operator<<(std::ostream& os, const InfoSet& iset);

	/* infos */
	protected:
	EInfoId iid;
	int firstIndex[I_SOURCE_TYPES];
	int sourceAmount[I_SOURCE_TYPES];
	std::vector<Info> infos;
};

#endif
